package usually;

class Father {//同时需要注意class 之前没有 public 关键字
    protected static int i = 0;
    //private  static  int i = 0;  父类中的private修饰的变量是不可以被访问的
    public void say() {
        System.out.println("hhh~");
    }

    public Father() {
        System.out.println("this is father!");
    }

    public void work() {
        System.out.println("father work");
    }
}

public class Son extends Father {//Son为这个文件的文件名
    public Son() {
        System.out.println("this is Son!");
    }

    public void say() {
        System.out.println("hello~");
    }

    public void think() {
        System.out.println("son think");
    }

    public static void main(String []ars){
        System.out.println(i);//i have private access in two.Father
        Father s = new Son();
        s.say();
//        s.think();
        s.work() ;
    }
}